Skip to content

fix(core): allow action config to override assertion dataset and project - #2455

Draft
Ford544 wants to merge 2 commits into
mainfrom
inline-assertion-config
Draft

Ford544 wants to merge 2 commits into
mainfrom
inline-assertion-config

Conversation

@Ford544

@Ford544 Ford544 commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Addresses #1295

Current behavior:

Inline assertions (assertion actions generated automatically from the assertions block in action config) always run with the default project and default assertion dataset. Action-level "schema" and "project" overrides do not apply to them.

Example:

workflow_settings.yaml:

defaultProject: default_project
defaultDataset: dataform
defaultAssertionDataset: dataform_assertions

some_action.sqlx:

config {
   database: "specific_project",
   dataset: "specific_dataset",
   type: "table",
   assertions: {
    uniqueKey: ["id"]
  }
}
select 1 as id

Result: the table action itself runs in specific_project.specific_dataset, while the uniqueKey assertion runs in default_project.dataform_assertions.

As such there is currently no way to override the default project and dataset for inline assertions.

Proposed change

Make action-level database override apply to inline assertions (assumption: users typically will want to keep data and assertions results in the same project).
In case a different database for assertions is needed, also allow to set the database field inside the assertions block. This then applies only to inline assertions in that action and takes precedence over action-level database override.

For datasets, defaultAssertionDataset should still take precedence over the action-level dataset override (assumption: it is usually preferred to keep data and assertion results in different datasets).
If defaultAssertionDataset is unset, fall back to the action-level dataset if set, then to defaultDataset.
Also allow setting the dataset inside the assertions block. This then applies only to inline assertions in that action and takes precedence over action-level dataset override.

Order of precedence for inline assertions:
project: assertions-level override > action-level override > defaultProject
dataset: assertions-level override > defaultAssertionDataset > action-level override > defaultDataset

This resolves the issue #1295 by applying action-level project overrides to inline assertions and grants users a fine control over which datasets assertions write to.

Breaking change: this can affect the behavior of existing projects under certain edge conditions, such as:

  • if the user relied on the "inline assertions do not inherit action's project" behavior to keep data and assertions in different projects - unlikely, and can be fixed by adding assertions-level project overrides
  • if the user did not set defaultAssertionDataset and relied on the "inline assertions do not inherit action's dataset" behavior to keep data and assertions in different datasets in actions with a dataset override - unlikely, and can be fixed by setting defaultAssertionDataset

@Ford544
Ford544 force-pushed the inline-assertion-config branch from 2f5ab93 to 6b97cbe Compare November 18, 2026 10:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant